import axios from "axios";

const service = axios.create({
    baseURL: process.env.VUE_APP_BASE_AP,
    timeout: 10000
})

service.interceptors.request.use(config => {
    // @ts-ignore
    config.headers['Content-Type'] = 'application/json;charset=UTF-8'
    return config
}, error => {
    return Promise.reject(error)
})


service.interceptors.response.use(response => {
    const data = response.data
    return data
}, error => {
    return Promise.reject(error)
})

export default service
